package game.views;

import game.views.RoleLogView.WinState;
import hx.shader.GeryShader;
import hx.ui.UIManager;
import hx.display.HBox;

/**
 * 胜利失败状态组件
 */
@:build(hx.macro.UIBuilder.build("assets/views/RoleWinLoseState.xml"))
class RoleWinLoseState extends HBox {
	public function setData(winState:WinState, winTimes:Int):Void {
		this.state.data = UIManager.getBitmapData(winState == WIN ? "img_pvp_win" : "img_pvp_lose");
		this.win1.shader = winTimes < 1 ? new GeryShader() : null;
		this.win2.shader = winTimes < 2 ? new GeryShader() : null;
	}
}
